package org.meb.lotrlcg.db.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

import org.hibernate.annotations.Type;

@Getter
@Setter
@NoArgsConstructor
@ToString
@Entity
@Table(name = "vw_card")
// @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Card {

	private String ability;
	private Integer attack;
	private Long crstId;
	private String crstDescription;
	private String crstName;
	private String crstReleaseDate;
	private String crstSymbol;
	private String crstTechName;
	private Integer cost;
	private Integer defense;
	// private String encounterInfo;
	// private String encounterSet;
	private Integer engageThreat;
	private Long enstId;
	private String enstName;
	private String enstTechName;
	private Date faqDate;
	private String faqText;
	private String faqVersion;
	private Integer hitPoints;
	private String illustrator;
	private String name;
	private Integer number;
	private Integer quantity;
	private Integer questPoints;
	
	@Type(type = "org.hibernate.type.YesNoType")
	private Boolean localized;
	private String shadowEffect;

	@Enumerated(EnumType.STRING)
	private Sphere sphereCode;
	private String sphereDisplay;
	private Integer startingThreat;
	private String storyline;
	private String subName;
	private String techName;
	private String text;
	private Integer threat;
	private String trait;
	
	@NonNull
	@Enumerated(EnumType.STRING)
	private CardType typeCode;
	private String typeDisplay;

	@Column(name = "unq")
	@Type(type = "org.hibernate.type.YesNoType")
	private Boolean unique;
	private Integer willpower;

	@Id
	private Long id;

	@Version
	private Long version;

	public Card(Long id) {
		this.id = id;
	}

	public Card(CardType typeCode) {
		this.typeCode = typeCode;
	}
}
